Report Signal Table

To create a signal table use TPTReport.SignalTable() or TPTReport.SignalTraceTable(). There are two ways to add signals to the table. Either directly choose the signals to add using signalTable.add([signal1,signal2,...]) or indirectly by using a filter TPTReport.Filter().

Report signal table in the report

Example 1

As an example we create a signal table which includes all assessment variables (also the non exported) and the state information. A table like this can be very useful for debugging.

#creates a signal table, adds it to a new report section

sig_table = TPTReport.SignalTable()

sect = TPTReport.Section("My Section")

sect.add(sig_table)


#adds the new report section to the selected Report Section in the common assesslet settings

TPTReport.add(sect)

#add signal using a filter

sig_filter = TPTReport.Filter()

sig_filter.setShowAssessmentVariables(true)

sig_filter.setShowScriptVariables(true)

sig_filter.setShowNoneExported(true)

sig_table.setShowStateInfo(true)

sig_table.applyFilter(sig_filter)

sig_table.setShowInitialValues(true)

Example 2

This example explains how to add sorting criteria to the table. The table will be sorted by name in ascending order.

#creates a new signal table

sig_table = TPTReport.SignalTable()

sect.add(sig_table)

#add signal

sig_table.add([light_switch,light_intensity,headlight])

#add sorting criterion

sort_model = TPTReport.SortModel()

sort_model.addCriterion(TPTReport.CRITERION_NAME, TPTReport.ASCENDING)

sig_table.applySortModel(sort_model)